drop table jms_dm.dm_dev_repair_network_monitor_rfid_detail_dt;
CREATE TABLE jms_dm.dm_dev_repair_network_monitor_rfid_detail_dt
(
    type                int comment '1代表维修点2代表中心',
    scan_network_code   varchar(100) comment '本站点扫描网点编号',
    rfid                varchar(100) comment 'rfid',
    rfid_flag           int comment '1百世循环袋2极兔循环袋3文件循环袋4承映循环袋',
    scan_type_code      varchar(100) comment '扫描类型编号',
    scan_type_name      varchar(100) comment '扫描类型名称',
    package_code        varchar(100) comment '包号',
    scan_time           varchar(100) comment '扫描时间',
    input_time          varchar(100) comment '录入时间',
    scan_network_name   varchar(100) comment '本站点扫描网点名称',
    scan_staff_code     varchar(100) comment '扫描员工编号',
    scan_staff_name     varchar(100) comment '扫描员工名称',
    dest_network_code   varchar(100) comment '目的地网点编号',
    dest_network_name   varchar(100) comment '目的地网点名称',
    scan_id             varchar(100) comment '扫描id',
    date_time           date comment '扫描日期',
    network_type        int comment '网点类型',
    is_repair           int comment '是否维修点1是0否',
    before_network_code varchar(100) comment '上一个网点',
    before_type_code    varchar(100) comment '上一个网点扫描类型编号',
    before_type_name    varchar(100) comment '上一个网点扫描类型name',
    before_dest_code    varchar(100) comment '上一个网点目的网点code',
    before_dest_name    varchar(100) comment '上一个网点目的网点name',
    before_network_name varchar(100) comment '上一个网点name',
    before_network_type int comment '上一个网点类型',
    is_repair_before    int comment '上一站是否维修点1是0否',
    next_network_code   varchar(100) comment '下一个网点',
    next_type_code      varchar(100) comment '下一个网点扫描类型编号',
    next_type_name      varchar(100) comment '下一个网点扫描类型name',
    next_dest_code      varchar(100) comment '下一个网点目的网点code',
    next_dest_name      varchar(100) comment '下一个网点目的网点name',
    next_network_name   varchar(100) comment '下一个网点name',
    next_network_type   int comment '下一个网点类型',
    is_repair_next      int comment '下一站是否维修点1是0否'
) ENGINE=OLAP
DUPLICATE KEY(type,scan_network_code)
COMMENT "维修点监控报表明细"
PARTITION BY RANGE(date_time)
(START ('2023-12-01') END ('2024-01-20') EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(rfid) BUCKETS 1
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "1",
"in_memory" = "false",
"storage_format" = "V2",
"enable_persistent_index" = "false"
);